<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />
<title>登录页面 监狱人员后台管理系统</title>
<link rel="icon" href="res/images/favicon.ico" type="image/ico">
<meta name="keywords" content="监狱人员后台管理系统">
<meta name="description" content="监狱人员后台管理系统。">
<meta name="author" content="yinqi">
<link href="res/css/bootstrap.min.css" rel="stylesheet">
<link href="res/css/materialdesignicons.min.css" rel="stylesheet">
<link href="res/css/style.min.css" rel="stylesheet">
<style>
body {
    display: -webkit-box;
    display: flex;
    -webkit-box-pack: center;
    justify-content: center;
    -webkit-box-align: center;
    align-items: center;
    height: 100%;
}
.login-box {
    display: table;
    table-layout: fixed;
    overflow: hidden;
    max-width: 700px;
}
.login-left {
    display: table-cell;
    position: relative;
    margin-bottom: 0;
    border-width: 0;
    padding: 45px;
}
.login-left .form-group:last-child {
    margin-bottom: 0px;
}
.login-right {
    display: table-cell;
    position: relative;
    margin-bottom: 0;
    border-width: 0;
    padding: 45px;
    width: 50%;
    max-width: 50%;
    background: #67b26f!important;
    background: -moz-linear-gradient(45deg,#67b26f 0,#4ca2cd 100%)!important;
    background: -webkit-linear-gradient(45deg,#67b26f 0,#4ca2cd 100%)!important;
    background: linear-gradient(45deg,#67b26f 0,#4ca2cd 100%)!important;
    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#67b26f', endColorstr='#4ca2cd', GradientType=1 )!important;
}
.login-box .has-feedback.feedback-left .form-control {
    padding-left: 38px;
    padding-right: 12px;
}
.login-box .has-feedback.feedback-left .form-control-feedback {
    left: 0;
    right: auto;
    width: 38px;
    height: 38px;
    line-height: 38px;
    z-index: 4;
    color: #dcdcdc;
}
.login-box .has-feedback.feedback-left.row .form-control-feedback {
    left: 15px;
}
@media (max-width: 576px) {
  .login-right {
      display: none;
  }   
}
</style>
</head>
  
<body style="background-image: url(res/images/login-bg-2.jpg); background-size: cover;">
<div class="bg-translucent p-10">
  <div class="login-box bg-white clearfix">
    <div class="login-left">
      <form action="/Final_ssm2/admin/login" method="post">
        <div class="form-group has-feedback feedback-left">
          <input type="text" placeholder="请输入您的用户名" class="form-control" name="username" id="username" />
          <span class="mdi mdi-account form-control-feedback" aria-hidden="true"></span>
        </div>
        <div class="form-group has-feedback feedback-left">
          <input type="password" placeholder="请输入密码" class="form-control" id="password" name="password" />
          <span class="mdi mdi-lock form-control-feedback" aria-hidden="true"></span>
        </div>
        <div class="form-group">
          <button class="btn btn-block btn-primary" id="btn" name="btn" type="button">立即登录</button>
        </div>
      </form>
    </div>
    <div class="login-right">
      <p></p>
      <p class="text-white m-tb-15">监狱人员后台管理系统</p>
      <p class="text-white">Copyright © 2021 计科1809. All right reserved</p>
    </div>
  </div>
</div>
<script type="text/javascript" src="res/js/jquery.min.js"></script>
<script type="text/javascript" src="res/js/bootstrap.min.js"></script>
<script type="text/javascript">
$("#btn").click(function(){
  $.ajax({
    method: 'post',
    url:'/Final_ssm2/admin/login',
    dataType:'json',    //data传递的是一个json类型的值，而不是字符串，且必须标明dataType的类型，否则会出现400错误或者其他错误。
    data: {
      "username": $("#username").val(),
      "password": $("#password").val(),
    },
    success:function (data) {
      console.log(data)
      if (data.message === "success"){
        window.location.href = 'index.html';
      }
    },
    error: function () {
      alert("网络错误");
    }
    })

});


/*
	/!* 刷新验证码 *!/
  function refresh() {
    document.getElementById("codeImg").src = "getCode?time=" + new Date().getTime();
  }*/
</script>
</body>
</html>